//== SAGITTARIUS ============================================================================

//== FILEDOC =========================================================================

/** @file modloader.h
  * @brief modloader
  */

//== BEGINNING OF CODE ===============================================================

#ifndef __SAGUTTARUIS__MODLOADER__H_
#define __SAGUTTARUIS__MODLOADER__H_

//== INCLUDES ========================================================================

#include "sagittarius/core/SagittariusCore.h"
#include "sagittarius/types/types.h"
#include "sagittarius/mod/module.h"

#ifdef __cplusplus
extern "C" {
#endif

typedef struct {
    SG_TYPE_PARAMS;
} sg_mod_loader_type;

typedef struct {
    SG_VAL_PARAMS
    uint64 n;
    sg_module** m;
} sg_mod_loader;

sg_mod_loader* sg_create_mod_loader();

void sg_release_mod_loader(sg_mod_loader*);

void sg_register_mod(sg_mod_loader* ml, sg_module* m);

sg_module* sml_fetch_module(sg_mod_loader* x, symcode s);

sg_value* sg_fetch_module(sg_value* mdld, symcode s);

#ifdef __cplusplus
}//extern "C"
#endif

#endif
